package wechat.base.snd;

import wechat.base.snd.WCServiceApp;
import wechat.base.snd.WCServiceAppMessage;
import wechat.base.snd.WCTemplateContent;
import wechat.base.snd.encoding.JsonPut;

@SuppressWarnings("all")
public class WCTemplateNews extends WCServiceAppMessage {
  public WCTemplateNews(final WCServiceApp sa) {
    this.app = sa;
    JsonPut _jsonPut = new JsonPut();
    this.content = _jsonPut;
  }
  
  public void withTempId(final String tmp_id) {
    this.content.putObj("template_id", tmp_id);
  }
  
  public void withUrl(final String url) {
    this.content.putObj("url", url);
  }
  
  public void withAuthUrl(final String url, final String state) {
    String _buildAuthConnection = this.app.buildAuthConnection(url, state);
    this.withUrl(_buildAuthConnection);
  }
  
  public void withData(final WCTemplateContent tc) {
    JsonPut _allContent = tc.getAllContent();
    this.content.putObj("data", _allContent);
  }
  
  public String getStr() {
    return this.content.toString();
  }
}
